<template>
  <view>
    <view class="ed-form margin-top bg-white">
      <!-- 姓名 -->
      <view class="cu-form-group" @tap="toggleModal('name')">
        <view class="title">姓名</view>
        <text>{{ userObject.username }}</text>
      </view>
	  <!-- 手机号码 -->
	  <view
	    class="cu-form-group"
	    @tap="jumpTo('/pages/mineProfile/editPhone?phone=' + userObject.phone_number)"
	  >
	    <view class="title">手机号码</view>
	    <view>
	      <text>{{ userObject.phone_number }}</text>
	      <text class="lg cuIcon-right margin-left-sm"></text>
	    </view>
	  </view>
	  <view class="cu-form-group" @tap="jumpTo('/pages/settingsPage/logoff')">
	    <view class="title">注销帐号</view>
		<text class="lg cuIcon-right margin-left-sm"></text>
	  </view>
    </view>
  </view>
</template>

<script>
	const Page = require('../../utils/mtj-wx-sdk.js').Page;
import { editUserInfo,registered } from '../../api/user.js'
import { mapMutations } from "vuex";
import wPicker from "@/components/w-picker/w-picker.vue";
export default {
	components:{
		wPicker
	},
  data() {
    return {
      userObject: {
		  reg_auth_time:''
	  },
      educationStatus: true,
	  educationStatusName:'已毕业',
      educationStatusPicker: ["已毕业", "在读"],
	  genderStatus:true,
	  genderStatusPicker:["男", "女"],
	  gender:'男',
      highestEducation: 3,
	  highestEducationName:"本科",
      diplomaPicker: ["初中", "高中/中专", "大专", "本科", "硕士", "博士"],
	  house_addr_now:'',
	  work_history:'',
	  skill:'',
	  regionDval:['江苏省','常州市','钟楼区'],
	  address:'省市区',
	  school:'',
	  isRegistered:false,
	  type:'',
	  username:'',
	  age:'',
	  timer:null,
	  showText:false
    };
  },

  methods: {
    ...mapMutations(["getUserInfo"]),
    jumpTo(url) {
      uni.navigateTo({
        url: url
      });
    },
  },
  onShow() {
	  // this.registered()
	  //获取用户资料
    this.getUserInfo({ cb: (res) => {
      this.userObject = res;
    }});
  },
  onUnload:function(){
  	if(this.timer) {  
  		clearInterval(this.timer);  
  		this.timer = null;  
  	}  
  },
};
</script>

<style lang="scss" scoped>
.ed-form__avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
}
.cu-form-group {
  input::placeholder {
    direction: rtl;
  }
  text{
	  font-size: 17px;
	  color:#999999;
  }
}
.ed-tip {
  padding: 15px 16px;
  font-size: 12px;
  font-weight: 400;
  color: rgba(136, 136, 136, 1);
  line-height: 17px;
}
.ed-footer {
  display: flex;
  position: fixed;
  bottom: 0;
  width: 100%;
  z-index: 9;
  .ed-footer__cancel {
    padding: 14px 0;
    width: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #ffffff;
    font-size: 16px;
    font-weight: 500;
    color: rgba(16, 137, 255, 1);
    line-height: 22px;
  }
  .ed-footer__save {
    padding: 14px 0;
    width: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(
      204deg,
      rgba(110, 211, 255, 1) 0%,
      rgba(16, 137, 255, 1) 100%,
      rgba(16, 137, 255, 1) 100%
    );
    font-size: 16px;
    font-weight: 500;
    color: rgba(255, 255, 255, 1);
    line-height: 22px;
  }
}
.mp-list {
    background-color: #ffffff;
    margin-bottom: 10px;
    .mp-list__inner {
      padding: 14px 0;
      margin: 0 16px;
      border: none;
      border-bottom: 1px solid #f1f1f1;
      display: flex;
      justify-content: space-between;
      .mp-list__title {
        font-size: 17px;
        font-weight: 400;
        color: rgba(51, 51, 51, 1);
        line-height: 24px;
      }
    }
  }
  .uni-textarea textarea{
	  padding: 13px 16px;
	  width: 100%;
  }
  .down{
	  float: right;
	  display: inline-block;
	  margin-top: 2px;
	  width: 20px;
	  height: 20px;
	  margin-left: 10px;
  }
  textarea{
	  font-size: 17px;
	  color:#999999;
  }
  .title{
	  font-size: 17px;
  }
  .picker{
	  font-size: 17px!important;
  }
.w-picker .w-picker-hd .w-picker-btn {
    color: #007aff !important;
}
.gzBox{
	height: 150px;
  width: 289px;
  background-color: #fff;
  border-radius:4px;
  margin: 0 auto;
  position: relative;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  padding: 23px;
  box-sizing: border-box;
}
.gzBox div:first-child{
  font-weight:500;
  font-size: 17px;
  padding: 17px 0;
}
.gzBox div:nth-child(2){
  text-align: left;
}
.gzBox input{
	border-bottom: 1px solid #CCCCCC;
	text-align: center;
	width: 50%;
}
.gzBox button{
  margin-top: 31px;
  background: linear-gradient(270deg,rgba(16,137,255,1) 0%,rgba(83,170,255,1) 100%);
  border-radius: 24px;
  width: 100px;
  height: 30px;
  color: #FFFFFF;
  line-height: 30px;
  font-size: 12px;
}
</style>
